<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
	<th:block th:include="include :: header('查看角色用户')" />
</head>
<body class="gray-bg">
	<div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="role-form">
				    <input type="hidden" id="roleId" name="roleId" th:value="${role.id}">
					<div class="select-list">
						<ul>
							<li>
								登录名称：<input type="text" name="name"/>
							</li>
							<li>
								手机号码：<input type="text" name="mobile"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							    <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
	        
	        <div class="btn-group-sm" id="toolbar" role="group">
		        <a class="btn btn-warning" onclick="closeItem()">
		            <i class="fa fa-reply-all"></i> 关闭
		        </a>
	        </div>
	        
	        <div class="col-sm-12 select-table table-striped">
			    <table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
	<th:block th:include="include :: footer" />
	<script th:inline="javascript">
		var datas = [[${@dict.getType('sys_user_active')}]];
		var prefix = ctx + "system/role/authUser";
		$(function() {
			var options = {
		        url: prefix + "/allocatedList",
		        queryParams: queryParams,
		        modalName: "用户",
		        columns: [{
		            checkbox: true
		        },
		        {
		            field: 'userid',
		            title: '用户ID',
		            visible: false
		        },
		        {
		            field: 'name',
		            title: '登录名称',
		            sortable: true
		        },
		        {
		            field: 'deptIdList_dictText',
		            title: '部门'
		        },
		        {
		            field: 'email',
		            title: '邮箱'
		        },
		        {
		            field: 'mobile',
		            title: '手机'
		        },
		        {
		        	field: 'active',
		        	title: '用户状态',
		        	align: 'center',
		        	formatter: function (value, row, index) {
		        		return $.table.selectDictLabel(datas, value);
		        	}
		        },
		        {
		            field: 'updateTime',
		            title: '创建时间',
		            sortable: true
		        }]
		    };
		    $.table.init(options);
		});
		
		function queryParams(params) {
			var search = $.table.queryParams(params);
			search.roleId = $("#roleId").val();
			return search;
		}
	</script>
</body>
</html>